local skel = fk.CreateSkill {
  name = "efengqi__zhendu",
}

Fk:loadTranslationTable{
  ["efengqi__zhendu"] = "鸩毒",
  [":efengqi__zhendu"] = "一名角色的出牌阶段开始时，你可以弃置一张手牌。若如此做，该角色视为使用一张【酒】，然后若该角色不为你，你对其造成1点伤害。",

  ["#efengqi__zhendu-invoke"] = "鸩毒：你可以弃置一张手牌视为 %dest 使用一张【酒】，然后你对其造成1点伤害",
  ["#efengqi__zhendu-self"] = "鸩毒：你可以弃置一张手牌视为使用一张【酒】",

  ["$efengqi__zhendu1"] = "斩草务尽，以绝后患。", -- 男配音
  ["$efengqi__zhendu2"] = "这皇宫，只能有一位储君。", -- 女配音
}

skel:addEffect(fk.EventPhaseStart, {
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target.phase == Player.Play and not player:isKongcheng() and not target.dead
  end,
  on_cost = function(self, event, target, player, data)
    local prompt = (target == player) and "#efengqi__zhendu-self" or "#efengqi__zhendu-invoke::"..target.id
    local cards = player.room:askToDiscard(player, {
      min_num = 1, max_num = 1, skill_name = skel.name, include_equip = false, prompt = prompt, skip = true
    })
    if #cards > 0 then
      event:setCostData(self, {tos = {target}, cards = cards } )
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke(skel.name, player:isMale() and 1 or 2)
    room:notifySkillInvoked(player, skel.name, "offensive", {target.id})
    room:throwCard(event:getCostData(self).cards, skel.name, player, player)
    if not target.dead then
      room:useVirtualCard("analeptic", nil, target, target, skel.name, true)
    end
    if player ~= target and not target.dead then
      room:damage{
        from = player,
        to = target,
        damage = 1,
        skillName = skel.name,
      }
    end
  end,
})

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@@efengqi__luanwu_zhendu-round", 0)
end)

return skel
